package com.electronic.modules.revoke.param;

import com.alibaba.fastjson.JSONObject;
import com.electronic.domain.CebsSdkProperties;
import com.electronic.valid.BeanValidator;
import lombok.Data;

import javax.validation.constraints.NotNull;


/**
 * @Author: IFCA
 * @Description: 撤销签章请求参数
 */
@Data

public class RevokeSignatureDTO {


    /**
     * 文件地址 path不能为空
     */
    private String path;
    /**
     * 撤章后文件地址
     */
    private String newPath;

    /**
     * 初始化CA信息
     */
    @NotNull(message = "初始化CA信息不能为空")
    private CebsSdkProperties cebsSdkProperties;

    public static RevokeSignatureDTO parse(String businessData){
        RevokeSignatureDTO dto = JSONObject.parseObject(businessData, RevokeSignatureDTO.class);
        //验证必填项
        BeanValidator.validateReturnException(dto);
        return dto;
    }
}
